package com.niodata.dp.core.usermgr.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonView;
import com.niodata.dp.core.usermgr.enums.SystemRole;
import com.niodata.dp.core.usermgr.view.AdminGroupsView;
import com.niodata.dp.core.usermgr.view.AdminListUserView;
import com.niodata.dp.core.usermgr.view.AdminUsersView;
import com.niodata.dp.core.usermgr.view.GroupMasterView;
import com.niodata.dp.core.usermgr.view.GroupMemberView;
import com.niodata.dp.core.usermgr.view.GroupResourcesView;
import com.niodata.dp.core.usermgr.view.PersonalInfoView;
import java.io.Serializable;
import java.sql.Timestamp;

@JsonInclude(Include.NON_NULL)
public class UserInfo implements Serializable {

  private Long userId;
  private String loginName;
  private String email;
  private String userName;
  private String password;
  private Timestamp createTime;
  private SystemRole role;
  private String detail;
  private String hdfsHome;
  private String hdfsUser;
  private boolean sync;

  public boolean isSync() {
    return sync;
  }

  public void setSync(boolean sync) {
    this.sync = sync;
  }

  @JsonView(value = {AdminUsersView.class, AdminListUserView.class, GroupResourcesView.class,
        PersonalInfoView.class, GroupMemberView.class})
  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  @JsonView(value = {AdminListUserView.class, PersonalInfoView.class, GroupMemberView.class})
  public String getLoginName() {
    return loginName;
  }

  public void setLoginName(String loginName) {
    this.loginName = loginName;
  }

  @JsonView(value = {AdminUsersView.class, PersonalInfoView.class, GroupMemberView.class})
  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  @JsonView(value = {AdminUsersView.class, AdminGroupsView.class, AdminListUserView.class,
        GroupMasterView.class, GroupResourcesView.class, PersonalInfoView.class,
        GroupMemberView.class})
  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  @JsonView(value = {PersonalInfoView.class})
  public Timestamp getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Timestamp createTime) {
    this.createTime = createTime;
  }

  @JsonView(value = {AdminUsersView.class})
  public SystemRole getRole() {
    return role;
  }

  public void setRole(SystemRole role) {
    this.role = role;
  }

  @JsonView(value = {AdminUsersView.class, PersonalInfoView.class})
  public String getDetail() {
    return detail;
  }

  public void setDetail(String detail) {
    this.detail = detail;
  }

  public String getHdfsHome() {
    return hdfsHome;
  }

  public void setHdfsHome(String hdfsHome) {
    this.hdfsHome = hdfsHome;
  }

  public String getHdfsUser() {
    return hdfsUser;
  }

  public void setHdfsUser(String hdfsUser) {
    this.hdfsUser = hdfsUser;
  }
}
